package com.itheima.genericity2;

import java.util.ArrayList;

public class Test1 {

    public static void main(String[] args) {

        //通配符和上下限
        //通配符：就是“？”，可以在使用泛型的时候，表示任意类型；E T K V是在定义时使用
        //泛型上限：<? extends E>，能接受的必须是E类型或者其子类；
        //泛型下限：<? super E>，能接受的必须是E类型或者其父类；
        ArrayList<Xiaomi> xiaomiList = new ArrayList<>();
        xiaomiList.add(new Xiaomi());
        xiaomiList.add(new Xiaomi());
        xiaomiList.add(new Xiaomi());
        go(xiaomiList);

        ArrayList<LiXiang> liXiangList = new ArrayList<>();
        liXiangList.add(new LiXiang());
        liXiangList.add(new LiXiang());
        liXiangList.add(new LiXiang());
        go(liXiangList);

        ArrayList<BiYaDi> biYaDiList = new ArrayList<>();
        biYaDiList.add(new BiYaDi());
        biYaDiList.add(new BiYaDi());
        biYaDiList.add(new BiYaDi());
        go(biYaDiList);

        /*ArrayList<Dog> dogList = new ArrayList<>();
        dogList.add(new Dog());
        dogList.add(new Dog());
        dogList.add(new Dog());
        go(dogList);*/

    }


    //需求：开发一个飞车的游戏
    public static void go(ArrayList<? extends Car> list){

    }
}
